Repository navigation
PDF thumbnail example: fix the comment, keep the thumbnail inside 300x300 - #82
Merged
Merged
Conversation
…x300 The example already converts page 1 straight to JPG, but its comment still described the old extract-then-convert chain and linked pdf-to-extract, which is now the AI data-extraction converter. ScaleImage and ScaleProportions are not pdf -> jpg parameters and the API ignored them, so the 300x300 request came back 300x388 for test.pdf. FitToSize keeps the thumbnail inside 300x300 (231x300). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Nov 6, 2026
Merged
Merged
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are reported for the PDF thumbnail example’s sizing and documentation updates.
No open issues 🎉
What changed in this PR
Updates the PDF thumbnail example to use supported sizing parameters and accurately describe its direct PDF-to-JPG conversion.
Changes:
- Replaces unsupported
ScaleImageandScaleProportionsparameters withFitToSizeto preserve aspect ratio within 300×300 pixels. - Corrects the comment and removes the obsolete PDF extraction link.
| File | Description |
|---|---|
Examples/CreatePdfThumbnail/Program.cs |
Corrects the conversion comment and updates thumbnail sizing parameters. |
Review effort: Balanced
This was referenced Nov 7, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The example already makes the thumbnail in one
pdf -> jpgcall, but:pdf -> extractis now the AI data-extraction converter (spec).ScaleImageandScaleProportionsare notpdf -> jpgparameters (spec) and the API ignores them. The 300x300 request came back 300x388 fortest.pdf(US Letter), byte for byte the same as without them.Change
ScaleImageandScaleProportionsare dropped.FitToSizekeeps the thumbnail inside 300x300 with its aspect ratio: 231x300.Verification
dotnet build Examples/CreatePdfThumbnail/CreatePdfThumbnail.csproj: build succeeded, 0 warnings.The example hard-codes
"api_token"and a Windows relative path, so I ran a copy of thisProgram.cswith only those two lines changed: the token from an environment variable and an absolute path toExamples/TestFiles/test.pdf. .NET SDK 10.0.401, production API, 2026-11-06.$TMPDIRis the local temp folder:test.jpgis 231x300 px, 8,858 bytes.Seen while running it, not changed here: the examples reach
TestFileswith either..\..\..\or..\..\..\..\, and this one uses three levels. From the build output folderbin\Debug\net10.0, only the four-level form reachesExamples\TestFiles.Only the example changes, not the library, so there is no CHANGELOG entry.
The thumbnail examples of the other SDKs are fixed in ConvertAPI/convertapi-library-python#61, ConvertAPI/convertapi-library-php#72, ConvertAPI/convertapi-library-ruby#42, ConvertAPI/convertapi-library-java#56, ConvertAPI/convertapi-library-node#123.
🤖 Generated with Claude Code